<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <tal:block metal:use-macro="structure/metatags.xhtml/standard" />

  <body>
    <tal:block metal:use-macro="structure/navbar.xhtml/standard" />
    <div class="content">

      <div class="row">
        <div class="col-sm-8 col-sm-push-4" tal:condition="index | NULL">

        </div>

        <div class="col-sm-8 col-sm-push-4" tal:condition="show | NULL">
          <table>
            <tr style="background-color:#e3e3e3; font-weight: bold; font-size: 1.3em;">
              <td>
                ${content_knowledge/page_name | NULL} - ${content_knowledge/datum | NULL}
                <div style="float:right;">
                  <span tal:condition="php:_SESSION['admin'] == True' | NULL">
                    <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-edit" aria-hidden="true" href="${getPath}/knowledge/edit/${content_knowledge/id | NULL}" />
                    <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-trash" aria-hidden="true" title="${text/template_knowledge_del | NULL}" href="${getPath}/knowledge/delete/${content_knowledge/id | NULL}" onclick="return confirm('${text/user_admin_news_link_del | NULL}');" />
                  </span>
                </div>
              </td>
            </tr>

            <tr>
              <td><span tal:content="structure content_knowledge/page_content | NULL" /></td>
            </tr>

            <tr>
              <td>
                <table tal:condition="content_knowledge/uploads | NULL">
                  <tr style="background-color:#e3e3e3; font-weight: bold;">
                    <td colspan="3">${text/knowledge_upload_hinweis | NULL}</td>
                  </tr>

                  <tr tal:repeat="upload content_knowledge/uploads">
                    <td style="width:80%;">${upload/name}</td>
                    <td style="width:10%;">${upload/size}</td>
                    <td style="width:10%;text-align:right;">
                      <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-save" aria-hidden="true" href="${getPath}${getURL}/download/${upload/name}" />
                    </td>
                  </tr>
                </table>
              </td>
            </tr>

            <tr>
              <td><b>${text/inventory_license_version | NULL}: ${content_knowledge/version | NULL} - ${text/template_knowledge_fast_words | NULL}:</b> ${content_knowledge/keywords | NULL}</td>
            </tr>
          </table>
        </div>

        <div class="col-sm-8 col-sm-push-4" tal:condition="edit | NULL">
          <tal:block metal:use-macro="structure/metatags.xhtml/editor" />
          <form name="edit" method="post" action="${getPath}/knowledge/save/${content_knowledge/id}" enctype="multipart/form-data">
            <table>
              <tr style="background-color:#e3e3e3; font-weight: bold;">
                <td>
                  <div style="width:90%;float:left;">
                    <input type="text" name="page_name" class="form-control" value="${content_knowledge/page_name | NULL}" placeholder="${text/template_inventory_site_menu | NULL}" />
                  </div>
                  <div style="float:right;">
                    <button type="submit" aria-label="Left Align" title="${text/template_inventory_save_contributio | NULL}" class="btn btn-default glyphicon glyphicon-ok" aria-hidden="true" />
                    <a type="button" aria-label="Left Align" title="${text/system_cancel | NULL}" class="btn btn-default glyphicon glyphicon-remove" aria-hidden="true" href="javascript:history.back();" />
                  </div>
                </td>
              </tr>
              
              <tr>
                <td><textarea name="page_content" class="form-control" id="contactComment" style="width:100%;height:500px;font-size:0.9em;">${content_knowledge/page_content | NULL}</textarea></td>
              </tr>
              
              <tr>
                <td><input type="text" name="keywords" class="form-control" value="${content_knowledge/keywords | NULL}" placeholder="${text/template_inventory_search_help | NULL}" /></td>
              </tr>
              
              <tr>
                <td><input type="file" name="filesToUpload[]" id="filesToUpload" multiple="multiple" onChange="makeFileList();" /><br /><ul id="fileList"></ul> </td>
              </tr>
            </table>
          </form>
        </div>

        <div class="col-sm-8 col-sm-push-4" tal:condition="new | NULL">
          <tal:block metal:use-macro="structure/metatags.xhtml/editor" />
          <form name="new" method="post" action="${getPath}/knowledge/save" multipart="" enctype="multipart/form-data">
            <table>
              <tr style="background-color:#e3e3e3; font-weight: bold;">
                <td>
                  <div style="width:90%;float:left;">
                    <input type="text" name="page_name" class="form-control" placeholder="${text/template_inventory_site_menu | NULL}" />
                  </div>
                  <div style="float:right;">
                    <button type="submit" aria-label="Left Align" title="${text/template_inventory_save_contributio | NULL}" class="btn btn-default glyphicon glyphicon-ok" aria-hidden="true" />
                    <a type="button" aria-label="Left Align" title="${text/system_cancel | NULL}" class="btn btn-default glyphicon glyphicon-remove" aria-hidden="true" href="javascript:history.back();" />
                  </div>
                </td>
              </tr>
              
              <tr>
                <td><textarea name="page_content" class="form-control" id="contactComment" style="width:100%;height:600px;font-size:0.9em;"></textarea></td>
              </tr>
              
              <tr>
                <td><input type="text" name="keywords" class="form-control" placeholder="${text/template_inventory_search_help | NULL}" /></td>
              </tr>
              
              <tr>
                <td><input type="file" name="filesToUpload[]" id="filesToUpload" multiple="multiple" onChange="makeFileList();" /><br /><ul id="fileList"></ul> </td>
              </tr>
            </table>            
          </form>
        </div>

        <div class="col-sm-4 col-sm-pull-8">
          <tal:block metal:use-macro="structure/search.xhtml/standard" />
          <tal:block metal:use-macro="structure/submenu.xhtml/knowledge" />
          <tal:block metal:use-macro="structure/panel.xhtml/standard" />
        </div>
      </div>
    </div>

    <script src="${getPath}/assets/javascript/bootstrap.min.js"></script>
    <a name="bottom"></a>
  </body>
</html>
